import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

class InfoCard extends StatelessWidget {
  final String email;
  final List<String> vehicleVins;

  const InfoCard({super.key, required this.email, required this.vehicleVins});

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 20),
      padding: const EdgeInsets.all(20),
      decoration: BoxDecoration(
        color: Colors.white.withOpacity(0.9),
        borderRadius: BorderRadius.circular(20),
        boxShadow: [
          BoxShadow(
            color: Colors.grey.withOpacity(0.2),
            blurRadius: 10,
            offset: const Offset(0, 5),
          ),
        ],
        border: Border.all(color: const Color(0xFFD4AF37), width: 1),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            '车辆信息',
            style: TextStyle(
              fontSize: 20,
              fontWeight: FontWeight.bold,
              color: const Color(0xFFD4AF37),
            ),
          ),
          const SizedBox(height: 15),
          if (vehicleVins.isEmpty)
            const Text(
              '您没有车辆。',
              style: TextStyle(fontSize: 16, color: Colors.grey),
            )
          else
            Column(
              children:
                  vehicleVins.map((vin) {
                    return ListTile(
                      leading: Icon(
                        Icons.directions_car,
                        color: const Color(0xFFD4AF37),
                        size: 24,
                      ),
                      title: Text(
                        '车架号: $vin',
                        style: const TextStyle(
                          fontSize: 16,
                          color: Colors.black87,
                        ),
                      ),
                      contentPadding: EdgeInsets.zero,
                    );
                  }).toList(),
            ),
        ],
      ),
    );
  }
}
